package db;
import java.sql.*;

import po.AccountBookPo;
public class Database {	
	private static Connection connection;
	private static AccountBookPo defaultAB;
	
	private Database(){
		
	}
	
	public static void iniDatabase(String databaseIP,int databasePort,String databaseName,String username,String password) throws SQLException{
		connection=DriverManager.getConnection("jdbc:mysql://"+databaseIP+":"+databasePort+"/"+databaseName,username ,password);
	}
	
	public static void setDefaultAB(AccountBookPo ab){
		defaultAB=ab;
	}
	public static AccountBookPo getDefaultAB(){
		return defaultAB;
	}
	
	public static Connection getConnection(){
		return connection;
	}
	
}
